package com.common.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@TableName("apply")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Apply {

    // 差旅申请相关状态
    /** 差旅申请草稿 */
    public static final int TRAVEL_DRAFT = 0;

    /** 差旅申请未通过 */
    public static final int TRAVEL_REJECTED = 1;

    /** 差旅申请审核中 */
    public static final int TRAVEL_REVIEWING = 2;

    // 预支付款相关状态
    /** 预支付款审核中 */
    public static final int ADVANCE_REVIEWING = 3;

    /** 预支付款审核通过 */
    public static final int ADVANCE_APPROVED = 4;

    // 报销相关状态
    /** 报销申请未通过 */
    public static final int REIMBURSE_REJECTED = 5;

    /** 报销申请审核中 */
    public static final int REIMBURSE_REVIEWING = 6;

    /** 报销支付审核中 */
    public static final int PAYMENT_REVIEWING = 7;

    /** 已完成 */
    public static final int COMPLETED = 8;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;


    /**
     * 用户ID
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 申请号
     */
    @TableField("apply_id")
    private String applyId;

    /**
     * 开始时间
     */
    @TableField("start_time")
    private LocalDate startTime;

    /**
     * 结束时间
     */
    @TableField("end_time")
    private LocalDate endTime;

    /**
     * 出差目的
     */
    @TableField("purpose")
    private String purpose;

    /**
     * 目的地
     */
    @TableField("destination")
    private String destination;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 状态
     */
    @TableField("status")
    private Integer status;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;
}